#ifndef __ming_fyp_shadows_BiPCF2_h__
#define __ming_fyp_shadows_BiPCF2_h__

//------------------------------------------------------------------------------
// header includes
#include "fyp/ShadowAlgorithm.h"
#include "fyp/core/String.h"

#include <vector>


//------------------------------------------------------------------------------
namespace ming
{
namespace fyp
{
namespace shadows
{
	//--------------------------------------------------------------------------
	class TBiPCF2 : public IShadowAlgorithm
	{
		friend class TBiPCF2Gui;

	public:
		//------------------------------
		// #cstor & #dstor
		TBiPCF2();
		virtual ~TBiPCF2();
		
		//------------------------------
		// external operations
		virtual void Init(TResourcePool *resPool, TGuiManager *guiMgr);

		virtual void RenderScene(
			render::IRenderer *renderer,
			TResourcePool *resPool,
			TObjectManager *objMgr);
		
		virtual void Final(TResourcePool *resPool);
		
		virtual void ChangeShadowMapSize(size_t sz);
		
		virtual const char* GetDescription();

	private:
		//------------------------------
		// internal attributes
		int mPendingShadowMapSize;

		std::vector<TStr> mApplyTechniques;
		int mCurrApplyTechnique;

		//------------------------------
		// internal operations
		void GenerateShadowMap(
			render::IRenderer *renderer,
			TResourcePool *resPool,
			TObjectManager *objMgr);

		void RenderSceneWithShadowMap(
			render::IRenderer *renderer,
			TResourcePool *resPool,
			TObjectManager *objMgr);
	};
	
	//--------------------------------------------------------------------------
}
}
}


#endif	//__ming_fyp_shadows_BiPCF2_h__